package com.example.weblending.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

@Data
public class AnalyzeColumn extends CsvInputColumn {

    @ExcelProperty("")
    private int index;

    @ExcelProperty("is")
    private float is;

    @ExcelProperty("loanAmnt")
    private int loanAmnt;

    @ExcelProperty("term")
    private int term;

    @ExcelProperty("interestRate")
    private float interestRate;

    @ExcelProperty("installment")
    private float installment;

    @ExcelProperty("employmentLength")
    private int employmentLength;

    @ExcelProperty("homeOwnership")
    private int homeOwnership;

    @ExcelProperty("annualIncome")
    private int annualIncome;

    @ExcelProperty("dti")
    private float dti;

    @ExcelProperty("ficoRangeLow")
    private int ficoRangeLow;

    @ExcelProperty("ficoRangeHigh")
    private int ficoRangeHigh;

    @ExcelProperty("revolUtil")
    private float revolUtil;


    @Override
    public int hashCode() {
        int a=annualIncome;
        int f=((int)interestRate)<<4;
        int g=((int)installment)<<8;
        int e=employmentLength<<12;
        int c=loanAmnt<<16;
        //int b=((int)dti)<<20;
        //int h=((int)revolUtil)<<24;
        int d=homeOwnership<<28;
        int code=a  + c + d+e+f+g;
        //int code= b + d + f + g + h;
        return code;
    }

    //重写equals方法
    @Override
    public boolean equals(Object obj) {
        //判断内存地址
        if (obj == this) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        //判断是否是同一类型的对象
        if (obj instanceof AnalyzeColumn) {
           return obj.hashCode()==this.hashCode();
        }
        return false;
    }
}
